<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ page import="net.sf.json.*"%>
<%
	String libUrl =	null;
	//request.setAttribute("viewWidth","800");
	int viewWidth = 80; 
	if(null != request.getAttribute("viewWidth")){
	 viewWidth=Integer.valueOf((String)request.getAttribute("viewWidth"));
	 request.setAttribute("viewWidth",viewWidth);
	}	
	String smcPrefix = "";
	Map model = (Map) request.getAttribute("model");
	if (model == null) {
		model = new HashMap();
		// "unauthorized",新增一点功能。
		model.put("unauthorized", "OAAnnouncement");
		model.put("libUrl", "gmcc_ext");
		model.put("margins", "0 0 0 00");
		model.put("smcPrefix", "http://tp.cc.net/smc/mySmcPrefix");
		model.put("title", "test_title");
		model.put("layout", "TWT");
		model.put("name", "DEFAULT_HOMEPAGE");
		model.put("catalogId", "53c2f3ab-3795-4f44-a544-858fa3b9e2c0");
		{
			model.put("treeModelUrl",libUrl + "/data/emulation/channel.json");
		}
		Map channel = new HashMap();
		channel.put("serialNo", "1");
		channel.put("title", "天气预报");
		channel.put("height", 120);
		channel
				.put("contentUrl",
						"http://php.weather.sina.com.cn/search.php?city=%E5%B9%BF%E5%B7%9E&c=1&dpc=1");
		channel.put("layout", "T");
		channel.put("name", "GMCCInfoWeather_Channel");
		channel
				.put("catalogId",
						"2e9cf4db-ea29-4a48-9cfc-3e8edef966a3");
		channel.put("type", "1");
		Map channel1 = new HashMap();
		channel1.put("serialNo", "11");
		channel1.put("title", "要 闻");
		channel1.put("height", 160);
		channel1.put("contentUrl",
				"http://aa.bb.cc.com");
		channel1.put("layout", "W");
		channel1.put("name", "NEWS_YW");
		channel1.put("catalogId",
				"caedaf72-b44a-46f2-9559-67fd8648611a");
		channel1.put("type", "0");
		Map channel2 = new HashMap();
		channel2.put("serialNo", "10");
		channel2.put("title", "OA公告");
		channel2.put("contentUrl", "http://www.ee.ff.gg.com"
				);
		channel2.put("layout", "W");
		channel2.put("name", "OAAnnouncement");
		channel2.put("catalogId",
				"a7e0df5d-c6f8-455d-8af5-af2d609295ba");
		channel2.put("type", "0");
		
		Map channel3 = new HashMap();
		channel3.put("serialNo", 111);
		channel3.put("title", "股价");
		channel3.put("height", 160);
		// 对应的实际http位置：http://localhost:8080/Phase2/gmcc_ext/data/stock.html
		// 对应的物理文件路径：/home/gmcc/Workspaces/MyEclipse
		// 8.x/Phase2/WebRoot/gmcc_ext/data/stock.html
		channel3.put("contentUrl", "gmcc_ext/data/stock.html");
		channel3.put("layout", "T");
		channel3.put("name", "GMCCStockPrice");
		channel3.put("catalogId",
				"59f322bf-69f6-4660-9e23-8ea9dd0780bd");
		channel3.put("type", "0");
		ArrayList<Map> ary1 = new ArrayList();
		ary1.add(channel);
		ary1.add(channel1);
		ary1.add(channel2);
		ary1.add(channel3);
		model.put("channels", ary1);
		request.setAttribute("model", model);
	}

	if (null != model) {
		if (!model.containsKey("margins"))
			model.put("margins", "141 40 40 40");
		if (!model.containsKey("smcPrefix")
				|| ((String) model.get("smcPrefix")).length() == 0)
			model.put("smcPrefix", "http://pac-app.gmcc.net/smc");
		libUrl = (String) model.get("libUrl");
		smcPrefix = (String) model.get("smcPrefix");
	}
%>

<script language="javascript">
function debugObj1(obj) {
	var s = "";
	for (k in obj) {
		s += k + "=" + obj[k] + "\n";
	}
	alert(s);
}
   var model= <%=JSONObject.fromObject(request
									.getAttribute("model"))%>;
var viewWidth = <%=request.getAttribute("viewWidth")%>;	
var jst_template = <%=request.getAttribute("jst_template")%>
//request.getParameter("name");
//alert(request.getParameter("name"));
</script>
<link rel="stylesheet" type="text/css"
	href="<%=libUrl%>/ext/resources/css/ext-all.css" />
<script type="text/javascript"
	src="<%=libUrl%>/ext/adapter/ext/ext-base.js"></script>
<script type="text/javascript" src="<%=libUrl%>/ext/ext-all.js"></script>
<link rel="stylesheet" type="text/css"
	href="<%=libUrl%>/ext-portal/portal.css" />

<script type="text/javascript" src="<%=libUrl%>/ext-portal/Portal.js"></script>
<script type="text/javascript"
	src="<%=libUrl%>/ext-portal/PortalColumn.js"></script>
<script type="text/javascript" src="<%=libUrl%>/ext-portal/Portlet.js"></script>
<script type="text/javascript" src="<%=libUrl%>/ext-portal/iframe.js"></script>
<script type="text/javascript" src="<%=libUrl%>/ext-portal/iframe-fix.js"></script>
<script type="text/javascript" src="<%=libUrl%>/trimpath/template.js"></script>



<script type="text/javascript"
	src="<%=libUrl%>/javascripts/myRefactor/saveCurLayoutFn.js"></script>
<script type="text/javascript"
	src="<%=libUrl%>/javascripts/myRefactor/myPortalPanel.js"></script>
<script type="text/javascript"
	src="<%=libUrl%>/javascripts/myRefactor/handleMaximizeFn.js"></script>
<script type="text/javascript"
	src="<%=libUrl%>/javascripts/myRefactor/myPortletPanel.js"></script>
<script type="text/javascript"
	src="<%=libUrl%>/javascripts/myRefactor/handleMinimizeFn.js"></script>

<script type="text/javascript"
	src="<%=libUrl%>/javascripts/myNewjs/MyChannalTree.js"></script>
<script type="text/javascript"
	src="<%=libUrl%>/javascripts/myNewjs/MyTopPanel.js"></script>
<script type="text/javascript"
	src="<%=libUrl%>/javascripts/myNewjs/MyTopPanel1.js"></script>
<script type="text/javascript"
	src="<%=libUrl%>/javascripts/myNewjs/MyCenterPanel.js"></script>
<script type="text/javascript"
	src="<%=libUrl%>/javascripts/myNewjs/setupDropTargetsFn.js"></script>
<script type="text/javascript"
	src="<%=libUrl%>/javascripts/myNewjs/getChannelFromNodeFn.js"></script>
<script type="text/javascript"
	src="<%=libUrl%>/javascripts/myNewjs/getCurLayout.js"></script>
<script type="text/javascript"
	src="<%=libUrl%>/javascripts/myNewjs/viewwidth.js"></script>	
<script type="text/javascript"
	src="/jst/jst_view.js"></script>	
		
<script>	
//var cp = new Ext.state.CookieProvider({	mode : global_page})
Ext.onReady(function() {
init_edit();
//init();
});
</script>
<script type="text/javascript" src="<%=libUrl%>/javascripts/index.js"></script>